// 方式一
// 时间：84ms - 61.85%
var searchInsert = function(nums, target) {
  for (let i = 0; i < nums.length; i++) {
    if (nums[i] >= target) return i;
  }
  return nums.length;
};

console.log(searchInsert([1, 3, 5, 7, 9], 4));
